package com.eclink.asset.portal.controller;


import com.eclink.asset.domain.dto.DistributeItem;
import com.eclink.asset.portal.domain.dto.MyPortalDTO;
import com.eclink.asset.portal.domain.dto.PortalDataBoardDTO;
import com.eclink.asset.portal.domain.dto.StatisticsChartQuery;
import com.eclink.asset.portal.service.DataBoardService;
import com.eclink.asset.service.AssetCategoryService;
import com.eclink.asset.sys.service.SysMenuServiceImpl;
import com.eclink.asset.warehouse.service.WarehouseService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.dto.query.RecordMenuQueryDTO;
import com.ruoyi.domain.entity.RecordMenuVisit;
import com.ruoyi.system.service.impl.SysDictDataServiceImpl;
import com.ruoyi.web.service.IndexService;
import com.ruoyi.web.service.RecordMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 首页的相关接口
 *
 * @author chenshixian
 */
@Api(tags="员工端门户接口")
@RestController
@RequestMapping("portal/userEnd")
public class PortalUserEndController {

    @Resource
    private IndexService indexService;

    @Resource
    private RecordMenuService recordMenuService;

    @Resource
    private AssetCategoryService assetCategoryService;

    @Resource
    private WarehouseService warehouseService;

    @Resource
    private SysMenuServiceImpl sysMenuService;

    @Resource
    private SysDictDataServiceImpl dictDataService;

    @Resource
    private DataBoardService dataBoardService;

    /**
     * 统计资产的总数量
     * @return 总数量
     */
    @ApiOperation("资产的各种数量")
    @GetMapping("/assetCountMapping")
    public AjaxResult assetCountMapping() {
        return AjaxResult.success(indexService.getAssetCountMap());
    }

    /**
     * 统计资产的总数量
     * @return 总数量
     */
    @ApiOperation("资产的列表")
    @GetMapping("/getAssetList")
    public AjaxResult getAssetList() {
        return AjaxResult.success(indexService.getAssetItemList());
    }


}
